<%--
  Created by IntelliJ IDEA.
  User: 18306
  Date: 2020/11/4
  Time: 16:15
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="C" uri="http://java.sun.com/jsp/jstl/core" %>
<% String path = request.getContextPath(); %>
<!DOCTYPE HTML>
<html xmlns:wb="http://open.weibo.com/wb"><head>
   <script type="text/javascript" async="" src="/static/js/conversion.js"></script>
    <script src="/static/js/allmobilize.min.js" charset="utf-8" id="allmobilize"></script>
    <style type="text/css"></style>
    <meta content="no-siteapp" http-equiv="Cache-Control">
    <link  media="handheld" rel="alternate">
    <!-- end 云适配 -->
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
    <title>基本信息-招聘服务-拉勾网-最专业的互联网招聘平台</title>
    <meta content="23635710066417756375" property="qc:admins">
    <meta name="description" content="拉勾网是3W旗下的互联网领域垂直招聘网站,互联网职业机会尽在拉勾网">
    <meta name="keywords" content="拉勾,拉勾网,拉勾招聘,拉钩, 拉钩网 ,互联网招聘,拉勾互联网招聘, 移动互联网招聘, 垂直互联网招聘, 微信招聘, 微博招聘, 拉勾官网, 拉勾百科,跳槽, 高薪职位, 互联网圈子, IT招聘, 职场招聘, 猎头招聘,O2O招聘, LBS招聘, 社交招聘, 校园招聘, 校招,社会招聘,社招">
    <meta content="QIQ6KC1oZ6" name="baidu-site-verification">

    <!-- <div class="web_root"  style="display:none">http://www.lagou.com</div> -->
<%--    <script type="text/javascript">--%>
<%--        var ctx = "http://www.lagou.com";--%>
<%--        console.log(1);--%>
<%--    </script>--%>
    <link href="http://www.lagou.com/images/favicon.ico" rel="Shortcut Icon">
    <link href="/static/css/style.css" type="text/css" rel="stylesheet">
    <link href="/static/css/external.min.css" type="text/css" rel="stylesheet">
    <link href="/static/css/popup.css" type="text/css" rel="stylesheet">
    <script type="text/javascript" src="/static/js/jquery.1.10.1.min.js"></script>
    <script src="/static/js/jquery.lib.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="/static/js/ajaxfileupload.js"></script>
    <script src="/static/js/additional-methods.js" type="text/javascript"></script>
    <!--[if lte IE 8]>
    <script type="text/javascript" src="/static/js/excanvas.js"></script>
    <![endif]-->
    <script type="text/javascript">
        var youdao_conv_id = 271546;
    </script>
    <script src="/static/js/conv.js" type="text/javascript"></script>
    <script src="/static/js/ajaxCross.json" charset="UTF-8"></script></head>

<style type="text/css">
    /*input[type="submit"]{*/
    /*    outline: none;*/
    /*    border-radius: 5px;*/
    /*    cursor: pointer;*/
    /*    background-color: #31B0D5;*/
    /*    border: none;*/
    /*    width: 70px;*/
    /*    height: 35px;*/
    /*    font-size: 20px;*/
    /*}*/

    /*form{*/
    /*    position: relative;*/
    /*    width: 200px;*/
    /*    height: 200px;*/
    /*}*/
    input[type="file"]{
        position: absolute;
        left: 0;
        top: 0;
        height: 200px;
        opacity: 0;
        cursor: pointer;
    }
</style>
<body>
<div id="body">
<%--    <div id="header">--%>
<%--        <div class="wrapper">--%>
<%--            <a class="logo" href="index.html">--%>
<%--                <img width="229" height="43" alt="拉勾招聘-专注互联网招聘" src="/static/images/logo.png">--%>
<%--            </a>--%>
<%--            <ul id="navheader" class="reset">--%>
<%--                <li><a href="index.html">首页</a></li>--%>
<%--                <li class="current"><a href="companylist.html">公司</a></li>--%>
<%--                <li><a target="_blank" href="">论坛</a></li>--%>
<%--                <li>--%>
<%--                    <a rel="nofollow" href="">简历管理</a>--%>
<%--                </li>--%>
<%--                <li><a rel="nofollow" href="create.html">发布职位</a></li>--%>
<%--            </ul>--%>
<%--            <dl class="collapsible_menu">--%>
<%--                <dt>--%>
<%--                    <span>jason&nbsp;</span>--%>
<%--                    <span class="red dn" id="noticeDot-1"></span>--%>
<%--                    <i></i>--%>
<%--                </dt>--%>
<%--                <dd><a href="positions.html">我发布的职位</a></dd>--%>
<%--                <dd><a href="positions.html">我收到的简历</a></dd>--%>
<%--                <dd class="btm"><a href="myhome.html">我的公司主页</a></dd>--%>
<%--                <dd><a href="jianli.html">我要找工作</a></dd>--%>
<%--                <dd><a href="accountBind.html">帐号设置</a></dd>--%>
<%--                <dd class="logout"><a rel="nofollow" href="login.html">退出</a></dd>--%>
<%--            </dl>--%>
<%--        </div>--%>
<%--    </div><!-- end #header -->--%>
    <div id="container">

        <div style="" id="stepTip">
            <a></a>
            <img width="803" height="59" src="/static/images/tiponce.jpg">
        </div>
        <div class="content_mid">
            <dl class="c_section c_section_mid">
                <dt>
                    <h2><em></em>填写公司信息</h2>
                </dt>
                <dd>
                    <form id="stepForm">
                        <div class="c_text_1"></div>
                        <img width="668" height="56" class="c_steps" alt="第一步" src="/static/images/step1.png">

                        <h3>公司全称</h3>
                        <input type="text" placeholder="请输入公司全程：如青岛百乐芬有限公司" value="" name="name" id="companyname" class="valid">
                        <span class="error" style="display:none;" id="companyNameError">公司名称格式不对</span>
                        <h3>公司Logo</h3>

                        <div class="new_product mt20" style="border: 3px solid grey;height: 200px;width:250px">
                            <img src="/static/images/bosslogo.png" alt="" value="1" width="100%" height="100%" id="prevView">
                            <input type="file" name="" id="filePic"   value="" onchange="prev(this)" style="border: 1px solid white;height: 200px;width:250px"/>
                            <span class="error" style="display:none;" id="logoError">请先选择公司logo</span>
                        </div>

                        <h3>所在城市</h3>
                        <div style="height: 15px;"></div>
                        <select  id="provinces" onchange="viewcities()"    style="border: 3px solid #F3F3F3;height: 45px;width:200px;font-size: 20px ">
                            <c:forEach items="${requestScope.cities}" var="city">
                                <option  id="province" value="${city.id}" style="font-size: 20px">${city.name}</option>
                            </c:forEach>
                        </select>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;
                        <select id="cities" style="border: 3px solid #F3F3F3;height: 45px;width:200px;font-size: 20px ">
                            <c:forEach items="${requestScope.cities.get(0).cities}" var="city">
                                <option id="city" value="${city.id}" style="">${city.name}</option>
                            </c:forEach>
                        </select>
                        <span class="error" style="display:none;" id="cityError">请先选择省市</span>
                        <h3>行业领域</h3>
                        <div>
                            <input type="hidden" value="" name="select_industry_hidden" id="select_industry_hidden" >
                            <input type="button" value="请选择行业领域" name="select_industry" id="select_industry" class="select">
                            <div class="dn" id="box_industry" style="display: none;">
                                <ul class="reset">
                                    <C:forEach items="${requestScope.industrys}" var="industry">
                                        <li value="${industry.id}">${industry.name}</li>
                                    </C:forEach>
                                </ul>
                            </div>
                            <span class="error" style="display:none;" id="industryError">请先选择行业领域</span>
                        </div>

                        <h3>公司规模</h3>
                        <div>
                            <input type="hidden" value="" name="select_scale_hidden" id="select_scale_hidden">
                            <input type="button" value="请选择公司规模" id="select_scale" class="select">
                            <div class="dn" id="box_scale" style="display: none;">
                                <ul class="reset">
                                  <c:forEach items="${requestScope.dictionaries}" var="dictionary">
                                      <li value="${dictionary.id}">${dictionary.name}</li>
                                  </c:forEach>
                                </ul>
                            </div>
                            <span class="error" style="display:none;" id="scaleError">请先选择公司规模</span>
                        </div>

                        <input type="button" value="保存，下一步" id="step" class="btn_big fr">
                    </form>
                </dd>
            </dl>
        </div>

        <!-------------------------------------弹窗lightbox  ----------------------------------------->

        <!------------------------------------- end ----------------------------------------->

        <script src="/static/js/step1.min.js" type="text/javascript"></script>

        <div class="clear"></div>
        <input type="hidden" value="13ae35fedd9e45cdb66fb712318d7369" id="resubmitToken">
        <a rel="nofollow" title="回到顶部" id="backtop" style="display: none;"></a>
    </div><!-- end #container -->
</div><!-- end #body -->
<div id="footer">
    <div class="wrapper">
        <a rel="nofollow" target="_blank" href="about.html">联系我们</a>
        <a target="_blank" href="http://www.lagou.com/af/zhaopin.html">互联网公司导航</a>
        <a rel="nofollow" target="_blank" href="http://e.weibo.com/lagou720">拉勾微博</a>
        <a rel="nofollow" href="javascript:void(0)" class="footer_qr">拉勾微信<i></i></a>
        <div class="copyright">&copy;2013-2014 Lagou <a href="http://www.miitbeian.gov.cn/state/outPortal/loginPortal.action" target="_blank">京ICP备14023790号-2</a></div>
    </div>
</div>

<script src="/static/js/core.min.js" type="text/javascript"></script>
<script src="/static/js/popup.min.js" type="text/javascript"></script>

<!--  -->


<div id="cboxOverlay" style="display: none;"></div><div id="colorbox" class="" role="dialog" tabindex="-1" style="display: none;"><div id="cboxWrapper"><div><div id="cboxTopLeft" style="float: left;"></div><div id="cboxTopCenter" style="float: left;"></div><div id="cboxTopRight" style="float: left;"></div></div><div style="clear: left;"><div id="cboxMiddleLeft" style="float: left;"></div><div id="cboxContent" style="float: left;"><div id="cboxTitle" style="float: left;"></div><div id="cboxCurrent" style="float: left;"></div><button type="button" id="cboxPrevious"></button><button type="button" id="cboxNext"></button><button id="cboxSlideshow"></button><div id="cboxLoadingOverlay" style="float: left;"></div><div id="cboxLoadingGraphic" style="float: left;"></div></div><div id="cboxMiddleRight" style="float: left;"></div></div><div style="clear: left;"><div id="cboxBottomLeft" style="float: left;"></div><div id="cboxBottomCenter" style="float: left;"></div><div id="cboxBottomRight" style="float: left;"></div></div></div><div style="position: absolute; width: 9999px; visibility: hidden; display: none;"></div></div></body></html>

<script>
    // let file;
    //上传图片
    function prev(event){
        $("#logoError").css("display","none");
        //获取展示图片的区域
        var img = document.getElementById("prevView");
        //获取文件对象
        let file = event.files[0];
        //获取文件阅读器
        let reader = new FileReader();
        reader.readAsDataURL(file);
        reader.onload = function(){
            //给img的src设置图片url
            img.setAttribute("src", this.result);
        }

        //判断是不是图片格式
        var patrn = /^.+\.(jpg|jpeg|bmp|gif|png)$/;
        if(!patrn.exec(file.name)){
            $("#logoError").css("display","block");
            $("#logoError").html("类型必须是.gif,jpeg,jpg,png中某种");
            return;
        }else{
            $("#logoError").css("display","none");
        }
        //判断图片的大小是否符合
        if($("#filePic")[0].files[0].size<1024*10||$("#filePic")[0].files[0].size>1024*100){
            $("#logoError").css("display","block");
            $("#logoError").html("上传文件的大小不能低于10k大于100k");
            return ;
        }else{
            $("#logoError").css("display","none");
        }

    }
    //给行业分类添加js效果
        $("#select_industry").click(function () {
            $("#box_industry").css("display","block");
        })
        $("#box_industry ul li").click(function () {
             $("#select_industry").val(""+$(this).html());
              $("#select_industry_hidden").val(""+$(this).val());
            $("#industryError").css("display","none");
             $("#box_industry").css("display","none");
        })
    //给公司规模添加分类
        $("#select_scale").click(function(){
             $("#box_scale").css("display","block");
        })
        $("#box_scale ul li").click(function () {

            $("#select_scale").val(""+$(this).html());

            $("#select_scale_hidden").val(""+$(this).val());
            $("#scaleError").css("display","none");
            $("#box_scale").css("display","none");
        })

    //选择省份的时候出来城市
        function viewcities() {
            var provinceid = $("#provinces").val();
            $.ajax({
                url: "/bossmanage/getcities",
                type: "post",
                async: false,
                dataType: "json",
                data: {id: provinceid},
                success: function (cities) {
                    $("#cities option").remove();
                    for (var i = 0; i < cities.length; i++) {
                        $("#cities").append("<option value=\"" + cities[i].id + "\">" + cities[i].name + "</option>");
                    }
                }
            });
        }
       //判定公司名称是否符合
       $("#companyname").blur(testCompanyName);
       function testCompanyName(){
           var name = $("#companyname").val();
           var regExp= /^[\(\)\（\）\u4E00-\u9FA5]+$/;
           if(regExp.test(name)){
               $("#companyNameError").css("display","none");
               return true;
           }else{
               $("#companyNameError").css("display","block");
               return false;
           }
       }
       //表单提交
       $("#step").click(function () {
           //返回图片的名字
           var logoname;
           //判定公司名是否正确
           if(testCompanyName()){
           }else{
               return;
           }
           //logo是否上传
           if($("#prevView").attr("src")=="/static/images/bosslogo.png"){
               $("#logoError").css("display","block");
               return;
           }else{
                let file = $("#filePic")[0].files[0];
               var patrn = /^.+\.(jpg|jpeg|bmp|gif|png)$/;
                //判断文件是不是符合图片格式
               if(!patrn.exec(file.name)){
                   $("#logoError").css("display","block");
                   $("#logoError").html("类型必须是.gif,jpeg,jpg,png中某种");
                   return;
               }else{
                   $("#logoError").css("display","none");
               }
                //判断文件是否是图片和大小是否合适

                 if($("#filePic")[0].files[0].size<1024*10||$("#filePic")[0].files[0].size>1024*100){
                     $("#logoError").css("display","block");
                     $("#logoError").html("上传文件的大小不能低于10k大于100k");
                     return ;
                 }else{
                     $("#logoError").css("display","none");
                 }

               //把文件上传到服务器并返回文件的名字
               var formData = new FormData();
               formData.append('file',file);  //添加图片信息的参数
               $.ajax({
                   url: '/bossmanage/uploadPic',
                   type: 'POST',
                   async:false,
                   cache: false, //上传文件不需要缓存
                   data: formData,
                   processData: false, // 告诉jQuery不要去处理发送的数据
                   contentType: false, // 告诉jQuery不要去设置Content-Type请求头
                   success: function (mes) {
                        logoname = mes;
                   },
                   error: function (mes) {

                   }
               })
           }
           //行业领域是否选择
           if($("#select_industry_hidden").val()==""){
               $("#industryError").css("display","block");
               return;
           }
           //公司规模是否选择
           if($("#select_scale_hidden").val()==""){
               $("#scaleError").css("display","block");
               return;
           }
           var companyname =  $("#companyname").val();
           var cityid = $("#cities").val();
           var industryid = $("#select_industry_hidden").val();
           var scaleid = $("#select_scale_hidden").val();
           var data={name:companyname,cityId:cityid,industryId:industryid,companyScaleId:scaleid,logo:logoname};

           $.ajax({
               url:"/bossmanage/addCompanyInfo",
               type:"post",
               data:data,
               success:function () {
                   window.location.href = "/bossmanage/addcompanyinfo2";
               }
           });


       })



</script>
